﻿<controls:ChildWindow x:Class="ShellLight.SearchWindow"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
           Width="300" Height="400" Margin="0,0,40,40"
           Title="ShellLight Launcher">
    <Grid x:Name="LayoutRoot" DataContext="{Binding}">
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="40" />
        </Grid.RowDefinitions>
        <ListBox Grid.Row="0" ItemsSource="{Binding SearchResultCommands}" x:Name="searchResultListBox" Visibility="{Binding SearchResultVisibility}">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <Image Source="{Binding IconSource}" Width="16" Height="16" />
                        <HyperlinkButton Content="{Binding}" Command="{Binding}" CommandParameter="{Binding Context}" VerticalAlignment="Center" Margin="2,0,0,0" />
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
        <StackPanel x:Name="topScoreStackPanel" Grid.Row="0" Visibility="{Binding TopScoreVisibility}" Orientation="Horizontal" Background="WhiteSmoke">
            <ListBox ItemsSource="{Binding TopScoreCommands}" x:Name="topScoreCommandListBox" Width="200">
                <ListBox.ItemTemplate> 
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <Image Source="{Binding IconSource}" Width="30" Height="30" />
                            <HyperlinkButton Content="{Binding Name}" Command="{Binding}" CommandParameter="{Binding Context}" VerticalAlignment="Center" Margin="5,0,0,0" />
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
            <StackPanel></StackPanel>
        </StackPanel>
        <StackPanel Grid.Row="1" Orientation="Horizontal" Background="WhiteSmoke">
            <TextBox Margin="5,0,0,0" Text="{Binding SearchText, Mode=TwoWay, UpdateSourceTrigger=Explicit}" x:Name="searchTextBox" Width="190"  Height="20"/>
        </StackPanel>
    </Grid>
</controls:ChildWindow>